const state = {
	identity: uni.getStorageSync("identity"),
	openId: uni.getStorageSync("openId")
}

const mutations = {
	SET_IDENTITY: (state, identity) => {
		state.identity = identity
	},
	SET_OPEN_ID: (state, openId) => {
		state.openId = openId
	}
}

const actions = {
	setOpenId({
		commit
	}, openId) {
		commit("SET_OPEN_ID", openId);
	},
	setIdentity({
		commit
	}, identity) {
		commit("SET_IDENTITY", identity);
	}
}

export default {
	namespaced: true,
	state,
	mutations,
	actions
}
